package javaStudy.代码块;

public class Example {
    public Integer x = 10;
    public static Integer y = 10;
    static {
        System.out.println("静态代码块执行：y = " + y);
    }
    {
        System.out.println("实例代码块执行：x + y = " + (x + y));
    }
    public Example(){

    }

    public Example(int a,int b){
        x = a;
        y = b;
    }

    @Override
    public String toString() {
        return "Example{" +
                "x=" + x + ',' +
                "y=" + y +
                '}';
    }
}